import request from '@/utils/request'

// 查询电子图片列表
export function listPicture(query) {
  return request({
    url: '/system/epicture/list',
    method: 'get',
    params: query
  })
}

// 查询电子图片详细
export function getPicture(id) {
  return request({
    url: '/system/epicture/' + id,
    method: 'get'
  })
}

// 新增电子图片
export function addPicture(data) {
  return request({
    url: '/system/epicture',
    method: 'post',
    data: data
  })
}

// 获取图片二进制文件
export function getPic(data) {
  return request({
    url: '/system/epicture/getPic',
    method: 'post',
    data: data,
    responseType:'arraybuffer'
  })
}


// 下载图片二进制文件
export function downloadPic(data) {
  return request({
    url: '/system/epicture/downloadPic',
    method: 'post',
    data: data,
    responseType:'arraybuffer'
  })
}


// 修改电子图片
export function updatePicture(data) {
  return request({
    url: '/system/epicture',
    method: 'put',
    data: data
  })
}

// 删除电子图片
export function delPicture(id) {
  return request({
    url: '/system/epicture/' + id,
    method: 'delete'
  })
}

// 获取文件类型
export function getpictype(id) {
  return request({
    url: '/system/epicture/getpictype/' + id,
    method: 'get'
  })
}

// 预览图片
export function getFile(id) {
  return request({
    url: '/system/epicture/getFile/' + id,
    method: 'get',
    responseType:'arraybuffer'
  })
}

// 批量下载
export function downloadMore(ids) {
  return request({
    url: '/system/epicture/downloadMore/' + ids,
    method: 'get',
    responseType:'arraybuffer'
  })
}
